cmake_minimum_required(VERSION 3.5)
project(ousterDriver)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)

# ==== Requirements ====
find_package(Eigen3 REQUIRED)
include_directories("${EIGEN3_INCLUDE_DIR}/")

find_package(PCL COMPONENTS common visualization io QUIET REQUIRED)
add_definitions(${PCL_DEFINITIONS})
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})

find_package(PkgConfig REQUIRED)
pkg_check_modules(JSONCPP jsoncpp)
message("FOUND CONFIG: ${JSONCPP_CONFIG}")
message("INCLUDE DIRS: ${JSONCP_INCLUDE_DIRS}")
message("LIBRARIES: ${JSONCPP_LIBRARIES}")
include_directories(${JSONCP_INCLUDE_DIRS})

find_package(CURL REQUIRED)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/core)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} DIR_SRCS_OUSTER_LIDAR_DRIVER)
add_library(ouster_driver SHARED
    ${DIR_SRCS_OUSTER_LIDAR_DRIVER}
)

target_link_libraries(ouster_driver
                    ${PCL_LIBRARIES} 
                    -ljsoncpp
                    -lcurl
                    )
